home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / bbs / log_date.zip / LOG-DATE.DOC < prev    next >
Text File  |  1992-11-11  |  7KB  |  140 lines

  1.                       Log-Date version 1.0
  2.                         Compiled 11/11/92
  3.                    Written By Leon McClatchey
  4.                    Sysop of The Twilight Zone
  5.                 316-241-0459 (9600 v.32/v.42bis)
  6.                   316-241-0499 (300-2400 Hayes)
  7.  
  8. Log-Date is a  handy little utility which was  written to help to
  9. automate the task of archiving the logs. I wrote it originally to
  10. help  me  to  automate  the  task  of automatically archiving the
  11. Activity logs for Wildcat at the end of the month, but then while
  12. I was in  the process of writing  it, I decided to  make it a bit
  13. more  universal so  I could  use  the  same program  to date  and
  14. archive all  of the logs  that I maintain  on my system.  To this
  15. end, all of my logs have one of three extensions tacked on to the
  16. end of the files. The Wildcat  Orientated logs all end in .00? in
  17. which the  last number denotes what  node the log is  used on. (I
  18. only run 3  nodes, but there may be bigger  boards that runs over
  19. 10 nodes, but the syntax would  be the same regardless. The other
  20. two  extensions  are  .Log  and  .Use.  There  are probably other
  21. extensions, but these are the only ones that I used, so these are
  22. the ones that this particular version will process.
  23.  
  24. Now, lets get  on to how to execute the  program. All the options
  25. are done directly from the command  line. (I intended to set this
  26. up  for Batch  File usage  so I  wanted to  keep it  as simple as
  27. possible).  The Syntax for the command is:
  28.  
  29.         LOG-DATE filename(no extension) <switches>
  30.  
  31. This program is only meant to  handle logs, and so the extensions
  32. will be ignored, and it  will only search for specific extensions
  33. within the directory. Yep, you've got  it, you have got to change
  34. to the directory of the log  you wish date for archiving purposes
  35. as the pathname will probably cause the program to error out, but
  36. then there  is a reason  for that  as  you will see  a little bit
  37. further in this document.
  38.  
  39. Now, for  the switches. There  are only three,  and they must  be
  40. preceded by "/" before you give the letter.  and they are:
  41.  
  42.         /D      Daily Date Processing
  43.         /W      Weekly Date Processing
  44.         /M      Monthly Date Processing
  45.  
  46. If  you  leave  off  the  switches,  the  program will default to
  47. monthly   date  processing.   These  switches   are  really  self
  48. explanatory. The Daily Date Processing will cause a dated copy to
  49. be created on a daily basis.  The name of the copied log will be:
  50.  
  51.         FLmmddyy.*      F:  Represents the first  letter of the
  52.                         old name.
  53.                         L:  Represents the last  letter of the old
  54.                         name.
  55.                         mm:  Represents  the  month  the copy was
  56.                         made.
  57.                         dd: Represents the Day the copy was made.
  58.                         yy:  Represents  the  Year  the  copy was
  59.                         made.
  60.  
  61. Simple huh, but wait, the plot thickens. Especially as we move on
  62. to discuss  what weekly date  processing entails! First  off all,
  63. the program  will check what  the date is,  and if it  is not the
  64. last day of the week (or  Saturday for you novices out there), it
  65. will not process the file. But  if it does process the file, then
  66. it creates yet a different style  of filenaming! And this is what
  67. that will look like!
  68.  
  69.         ???wwyyW.*      ???: The first three letters of the old
  70.                         name.
  71.                         ww:  Which week of the year it is.
  72.                         yy:  The year of the process.
  73.                         W:   Letter to denote weekly processing.
  74.  
  75. Are ya still with us? Well, great,  now we can take a look at how
  76. the monthly date  processing is done! As far  as processing goes,
  77. yep, you've got it! If it is not the end of the month, the log is
  78. not processed! And it does not  matter, it will not default to 30
  79. either. A little routine has been  included in the source code to
  80. even test for leap year so  that the log will always be processed
  81. on the last  day of the month. (Course that  may cause some wierd
  82. logs on  occasion, cause the logs  will always run from  the last
  83. day to  the second to  the last day  instead of the  first to the
  84. "31"!  But there is yet another twist!  And its all in the name!
  85.  
  86.         ????mmyy.*      ????: The first four letters of the old
  87.                         name.
  88.                         mm:  The  month  in  which  the  log  was
  89.                         processed.
  90.                         yy:  The  year  in   which  the  log  was
  91.                         processed.
  92.  
  93. Well, I  think that about covers  the switches. Of course  by now
  94. you've  noticed that  I haven't  said anything  about the  "*" or
  95. extension. For a  very good reason. The extension  will always be
  96. the same as  that of the original file. That  is the reason I put
  97. in  a  little  clause  to  test  for  specific  files  within the
  98. directory. The log I was testing this on was the log for Dataview
  99. which happens  to follow the  same nomenclature of  wildcat. But,
  100. the  executable  and  configuration  files  also  has the name of
  101. "DATAVIEW" and so if I let it be a indescriminate dating utility,
  102. it would also make copies of  those files. I didn't want that and
  103. so I locked it out!
  104.  
  105. Now, there are a couple more  areas to cover before we close this
  106. thing!  When  Log-Date  runs,  it  will  create  two files if any
  107. processing done. The first will be a log in the current directory
  108. that will  list what process was  done, the date it  was done and
  109. the time of execution. Each time  it is successfully run, it will
  110. add a line to the log. A sample log has been included in this zip
  111. package to give you an idea of the format of the log.
  112.  
  113. Another  little file  will also  be created,  but this  will be a
  114. zero-byte file which you can test for the existence of in a batch
  115. file and execute a set of commands if it is there.
  116.  
  117. The log file will be named, yep;
  118.  
  119.                Log-Date.Log
  120.  
  121. and the Run file will be called:
  122.  
  123.                 Log-Date.run
  124.  
  125. Can you see the similarity here? All ya need to do is to remember
  126. to use  "log-date.RUN" for the Batch  Test and "LOG-DATE.log" for
  127. future reference  as to what was  done and when. These  two files
  128. will be created in every directory that the program is run. I set
  129. it up like  that so I could keep track  of when the Telemate logs
  130. were archived, the Door Logs, and the Wildcat Logs.
  131.  
  132. Well, I guess that about covers  it! If you have any questions or
  133. would like to leave us some  feedback about the utility, I can be
  134. reached at the BBS and Number  at the beginning of this document.
  135. I will tell you that I will  not offer any guarantees (Had to put
  136. that in, see it in all  the software that I've got online). Could
  137. put a beg notice in, but why bother. If you like it use it, if ya
  138. don't, trash it! If ya want  something added to the next version,
  139. the number is up above.  So I guess that about covers it!
  140.